<?php
require(dirname(dirname(__FILE__)).'/libs/db.class.php');
class Setting{
    public $db;
    function __construct()
    {
        $this->db=new DB();
    }

    function index(){
        $output=['errcode'=>0,'msg'=>'success'];
        $sql="select * from site_settings where id=1";
        $res=$this->db->get_one($sql);
        if($res){
            $output['data']=$res;
        }else{
            $output['errcode']=1;
            $output['msg']='获取网站信息失败';
        }
        echo json_encode($output);
    }


}
?>